package com.panshi.service.impl;


import com.panshi.domain.ZxComment;
import com.panshi.domain.vo.PageBean;
import com.panshi.mapper.ZxCommentMapper;
import com.panshi.service.ZxArticleService;
import com.panshi.service.ZxCommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zhy
 * @since 2020-07-29
 */
@Service
public class ZxCommentServiceImpl implements ZxCommentService {
    @Resource
    private ZxCommentMapper zxCommentMapper;


    /**
     * 根据ID查询资讯相关的评论
     *
     * @return
     */
    @Override
    public List<ZxComment> getCommentBayZxId(PageBean pageBean) {
        return zxCommentMapper.getCommentBayZxId(pageBean);

    }

    /**
     * 查询评论回复
     * @return
     */
    @Override
    public List<ZxComment> getCommentReply(PageBean pageBean) {
        List<ZxComment> commentReply = zxCommentMapper.getCommentReply(pageBean);
        return commentReply;
    }

    /**
     * 新增评论
     *
     * @param zxComent
     * @return
     */
    @Override
    public int addZxComment(ZxComment zxComent) {
        return zxCommentMapper.addZxComment(zxComent);
    }

    /**
     * 评论点赞
     *
     * @param id
     * @return
     */
    @Override
    public int ZxCommentRaise(Integer id) {
        return zxCommentMapper.ZxCommentRaise(id);
    }

    /**
     * 评论详情
     *
     * @param id
     * @return
     */
    @Override
    public ZxComment getCommentBayId(Integer id) {
        return zxCommentMapper.getCommentBayId(id);
    }

}
